﻿
<!DOCTYPE html>
<!--[if IE 8]> <html lang="zh" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="zh" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<title>慧若停车订单支付确认</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="full-screen" content="yes">
<meta name="browsermode" content="application">
<meta name="x5-fullscreen" content="true">
<meta name="x5-page-mode" content="app">
	<script th:src="@{http://res.wx.qq.com/open/js/jweixin-1.2.0.js}" type="text/javascript"></script>
	<link th:href="@{/css/lxs_index.css}" rel="stylesheet" type="text/css"/>
	<link th:href="@{/css/lxsHeadFoot.css}" rel="stylesheet" type="text/css"/>
	<link th:href="@{/css/order_new.css}" rel="stylesheet" type="text/css"/>
	<link rel="stylesheet" th:href="@{/css/animate.min.css}"/> <!-- 动画效果 -->
	<link rel="stylesheet" th:href="@{/css/common.css}"/><!-- 页面基本样式 -->
	<script th:src="@{/js/jquery.min.js}" type="text/javascript"></script>
</head>
<style type="text/css">
	.box{
		width: 100%;
		height: 400px;
		position: relative;
	}
	.box img{
		width: 180px;
		height: 180px;
		position: absolute;
		top: 40%; left: 32%;
		margin-top: -33px;
		margin-left: -29px;
		vertical-align: middle;
	}
	.box span{ display: inline-block;
		height: 100%; width: 0;
		vertical-align: middle; }

</style>
<body style="height: 100%">

<!--<c:if test="${order == null}">-->
	<!--<div  class="box">-->
		<!--<img src="/images/order/no-order.png" >-->
		<!--<span style="text-align:center;font-size: 16px; width: 100%;font-weight: bold;color: #9c9c9c;margin-top: 340px;">暂无订单</span>-->
	<!--</div>-->


<!--</c:if>-->


	<div class="content">
		<div class="headTop">
			<span>停车确认</span>
		</div>
	</div>


	<div class="j_main m-main">
		<!--<%&#45;&#45;<div class="o_logo">-->
			<!--<span>下载APP更快捷</span><a href="" rel="nofollow">马上下载</a>-->
		<!--</div>&#45;&#45;%>-->
		<form action="" method="post" name="form_1">

			<div class="tit">
				<i></i>确认停车信息
			</div>
			<div class="txt">
				<dl>
					<dt>停车场名称</dt>
					<dd class="line30"><input disabled th:value="${order['parkName']}"></dd>
				</dl>
				<dl>
					<dt>车牌号码</dt>
					<dd class="line30">
						<input disabled th:value="${order['plateNo']}">
					</dd>
				</dl>

				<dl>
					<dt>入场时间</dt>
					<dd><input disabled th:value="${#dates.format(order['innerTime'],'yyyy-MM-dd HH:mm:ss')}"></dd>
				</dl>
				<dl>
					<dt>出场时间</dt>
					<dd><input disabled th:value="${#dates.format(order['enterTime'],'yyyy-MM-dd HH:mm:ss')}"></dd>
				</dl>
				<dl>
					<dt>停车分钟数</dt>
					<dd><input disabled th:value="${order['stopTime']}"></dd>
				</dl>
			</div>
			<input hidden id="orderId" th:value="${order['id']}">
			<div class="tit">
				<i></i>提示信息<br>
				<span>注：支付前请确认展示信息为您本人车辆信息</span>
			</div>
			<div class="txt txt2 J_baoxian">
			</div>
			<script type="text" id="j_baoxian_con"> <dl> <dt> <a href="javascript:;" class="j_baoxian_tit J_baoxian_info">*title*</a> <input type="hidden" name="*name1*" value="*id*" /> <input type="hidden" name="*name2*" value="*price*" /> </dt> <dd> <font><span class="j_baoxian_c">*price_c*</span><i class="more"></i></font> </dd> </dl> </script>
			<script></script>
		</form>
		<div class="submintFix">
			<dl>
				<dt>
					<lable class="price">
						订单总额 ￥<span th:text="${order['reallyMoney']}"></span>
				<!--<dd class="sbmFix"><button type="button" id="save" onclick="onBridgeReady()">提交订单</button></dd>-->

					</lable>
				</dt>
				<dd class="sbmFix"><button type="button" id="save" onclick="onBridgeReady()">提交订单</button></dd>
			</dl>
		</div>
	</div>

		<script th:src="@{/js/min_com.js}"></script>
		<script th:src="@{/js/jquery.hDialog.min.js}"></script>
		<script>
			function onBridgeReady(){
				WeixinJSBridge.invoke(
					'getBrandWCPayRequest', {
						"appId": `[[${appId}]]` ,     //公众号名称，由商户传入
						"timeStamp":`[[${timeStamp}]]`,         //时间戳，自1970年以来的秒数
						"nonceStr":`[[${nonceStr}]]`, //随机串
						"package":`[[${packageValue}]]`,
						"signType":"MD5",         //微信签名方式： 签名方式，默认为'SHA1'，使用新版支付需传入'MD5'
						"paySign":`[[${paySign}]]`, //微信签名
					},
					function(res){
						if(res.err_msg == "get_brand_wcpay_request:ok" ){
							$.dialog('alert','提示','您已经支付成功');
							// 使用以上方式判断前端返回,微信团队郑重提示：
							//res.err_msg将在用户支付成功后返回ok，但并不保证它绝对可靠。
						}
					});
			}
		</script>
		<script>
			var myVar;
            $(document).ready(function(){
                timerGo();
            });
            function timerGo(){
               myVar = setInterval(function(){
                    myTimer()
                },1000);
            }

			function myTimer() {
                var orderId = $("#orderId").val();
                $.ajax({
                    url: "/app/order/timerOrderCallBack",
                    type: "post",
                    data: {"orderId":orderId},
                    dataType: "json",
                    async: true,
                    success: function (data) {
                        if (data.success){
                            clearInterval(myVar);
                            window.location.href = "/app/order/pay_success";
						}
                    }
                });
			}


		</script>
</body>
</html>